using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices.WindowsRuntime;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using XYTerrain.Runtime;


namespace XYTerrain.Runtime
{
    #if UNITY_EDITOR
    [CreateAssetMenu(fileName = "EditorSceneData", menuName = "Object/EditorSceneData", order = 0), System.Serializable]
    public class EditorSceneData : ScriptableObject
    {
        public List<Texture2D> splitTextures = new List<Texture2D>();
        public List<string> splitTexturesPath = new List<string>();
        public List<SceneCollectionManager> collectionManagers = new List<SceneCollectionManager>(); // 持有的场景信息

        public bool dirty = false;  
        public int m_splitTime = 1;


        public bool useAssignScene = false;
        public SceneAsset globalScene;

        public Vector2 boundSize= Vector2.zero;
        
        
        public static string EditorSceneName = "EditorScene";




        public string globalScenePath
        {
            get
            {
                if (useAssignScene)
                {
                    return assignScenePath;
                }
                else
                {
                    return defaultGlobalScenePath;
                }
            }
        }

        public string globalSceneName
        {
            get
            {
                if (useAssignScene) return assignSceneName;
                else return defaultGlobalSceneName;
            }
        }



        public string assignSceneName;
        public string assignScenePath;
        public string defaultGlobalScenePath = $"/GlobalScene/GlobalScene.unity";
        public string defaultGlobalSceneName = "GlobalScene";
        


       

        public int splitTime
        {
            get => m_splitTime;
            set
            {
                if (  m_splitTime!=value)
                {
                    dirty = true;
                    m_splitTime = value;
                }
                    
            }
        }
        
    }



#endif
}

